package com.unism.util;

import java.util.ArrayList;
import java.util.List;

public class Constant {

	// 通信中间件当前所用通信协议名称(版本号)
	public static final String protocolVersionName = "1.8.5";

	public static final String message = "message";// 消息键

	public static final String sysName = "unism";// 初始化的系统用户名称
	public static final String sysPassword = "password";// 初始化的系统用户密码

	public static final String adminName = "admin";// 系统管理员用户名，其他用户不能与其同名

	public static final String SUCCESS = "success";
	public static final String FAILURE = "failure";

	public static final String powerTypeSuper = "0000";// 超级权限，超级管理员自动拥有
	public static final String powerTypeBase = "0010";// 基础信息权限组
	public static final String powerTypeMonitor = "0020";// 运行监控权限组
	public static final String powerTypeWaterRecord = "0030";// 用水记录权限组
	public static final String powerTypeCost = "0040";// 计费权限组
	public static final String powerTypeSys = "0050";// 系统管理权限组

	/*
	 * 角色类型 企业人员有专门的系统，所以本系统中没有企业人员角色
	 */
	// public static final String roleTypeId_company = "rt001" ;//企业人员角色
	public static final String roleTypeId_government = "rt100";// 政府人员角色
	public static final String roleTypeId_expert = "rt200";// 农业专家角色
	public static final String roleTypeId_sysManager = "rt900";// 系统管理员角色
	public static final String[][] roleTypes = {
			// {roleTypeId_company, "企业人员"},
			{ roleTypeId_government, "政府人员" }, { roleTypeId_expert, "农业专家" }, { roleTypeId_sysManager, "系统管理员" } };

	public static final Integer companyType_unit = 1;// 企业类型:公司
	public static final Integer companyType_person = 2;// 企业类型：个体户(农户)

	/*
	 * 用户类型，这里设定的值在手机软件中确定，见文档《Web通信接口.docx》 管理员：1； 农业专家：2； 政府或研究所官员：3； 企业或农户：4
	 */
	public static final Integer userType_admin = 1; // 管理员
	public static final Integer userType_expert = 2; // 农业专家
	public static final Integer userType_officer = 3; // 政府或研究所官员
	public static final Integer userType_farmer = 4; // 企业或农户

	public static final Integer messageType_group = 1; // 组织机构内存成员（管理员、专家、官员、企业或农户）之间的即时消息
														// (群组即时消息)，
	public static final Integer messageType_one2one = 2; // 非专家与专家之间的即时消息(两个人之间的即时消息)

	// 默认知识库知识优先级，优先级越值越小，级别越高，排序靠前
	public static final Integer defaultKnowPriority = 100;

	/**
	 * 是与否
	 * 
	 * @return
	 */
	public static final String YES = "1";
	public static final String NO = "0";
	public static final String YESZH = "启用";
	public static final String NOZH = "禁用";

	public static List<String[]> yesNo() {
		List<String[]> list = new ArrayList<String[]>();
		list.add(new String[] { YES, YESZH });
		list.add(new String[] { NO, NOZH });
		return list;
	}

	public static String getYesNo(String flag) {
		if (flag != null) {
			if (flag.equals(YES)) {
				return YESZH;
			} else if (flag.equals(NO)) {
				return NOZH;
			}
		}
		return null;
	}

	///////////////////////////////////////////
	// 行政区级别,中国:1 省(直辖市)2 市(直辖市区)3 县(区):4 乡镇(街道):5 村(社区):6
	public final static int regionLevel_1 = 1;
	public final static int regionLevel_2 = 2;
	public final static int regionLevel_3 = 3;
	public final static int regionLevel_4 = 4;
	public final static int regionLevel_5 = 5;
	public final static int regionLevel_6 = 6;

	// web.xml参数指向配置文件
	public static String SYSCONFIGFILES = "sysConfigFiles";

	//////////////////////////
	// 一些全局性的bean配置名称
	public static final String Bean_refreshOracleDBBusi = "gl.refreshOracleDbBusi";
	public static final String Bean_unismLogBusi = "unismLogBusi";

	// 记电计水计时
	public static final String countElecName = "记电"; // 记电
	public static final String countWaterName = "计水"; // 计水
	public static final String countHourName = "计时"; // 计时

	// 机井开启时账号余额的最小当量
	public static final Float WATER = 1.0f;
	public static final Float ELEC = 1.0f;
	// 账号开启状态 0表示开启1表示冻结
	public static final Integer start = 0;
	public static final Integer end = 1;

	// 用户开启状态 1表示开启0表示冻结
	public static final Integer User_Start = 0;
	public static final Integer User_End = 1;

	// 用户角色 0:admin 1:dev 2:user
	public static final Integer admin = 0;
	public static final Integer dev = 1;
	public static final Integer user = 2;

	// 分页查询默认的单页记录数
	public static final Integer rows = 10;

	// vo排序方式的规定,正序、倒序
	public static final String ASC = "asc";
	public static final String DESC = "desc";

	// 出地桩分支标示
	public static final String chnnl1 = "chnnl1";
	public static final String chnnl2 = "chnnl2";

	// 获取的实例类型
	public static final Integer GPRS = 1;
	public static final Integer UWS = 2;

	// 气象站关键字
	public static String Data46Root = "data46";
	public static String Data46WSRoot = "WS_46_Data";
	public static String Data46WSDevices = "WS_46_DeviceIds";
	public static String Data46WSDeviceData = "WS_46_";
	public static String Data46WSDeviceType = "DType_";
	
	//线程名
	public static String SEARCHDATATHREADPOOL = "WS-搜数服务线程池";
	public static String SSOUDPTHREADPOOL = "sso-udp服务线程池";
	
	
	//时间毫秒数

	public static final Long HALF_HOUR_TIME_MILLIS = 1800000L;
	public static final Long HOUR_TIME_MILLIS = 3600000L;
	public static final Long DAY_TIME_MILLIS = 86400000L;
	public  static final Long MONTH_TIME_MILLIS = 2592000000L;
	public  static final Long TWO_MONTHS_TIME_MILLIS = 2592000000L;
	
	//用户信息保存时间
	public static final Integer USER_LOGIN_INFO_TIMEOUT = 1800;
}
